<template>
	<view style="background-color: #fff;">
		<!-- <view style="display: flex;justify-content: space-around;height: 230upx;">
			<view style="margin-top: 30upx;">
				<image style="width: 170upx;height: 150upx;" src="../../../../static/jflogo.png" mode=""></image>
			</view>
			<view style="height: 200upx;">
				<view style="margin-top: 10upx;">
					<text>待释放积分值</text><text style="margin-left: 20upx;"> > </text>
					<view>{{jfz}}</view>
				</view>
				<view>
					<text>已释放积分值</text>
					<view>{{jfz_out}}</view>
				</view>
			</view>
		</view> -->
		<view class="container">
			<!-- 带上拉加载的数据列表 -->
			<view class="big-loading-text loading-text" style="height: 80upx;line-height: 80upx;">
				<text>时间</text>
				<text>数量</text>
				<text>来源</text>
			</view>
			<!-- 数据列表 -->
			<scroll-view scroll-y="true" style="height: 920upx;">
				<view v-if="code == 1" style="height: 100upx;color: #B81738;padding: 30upx;">
					<view style="font-size: 32upx;font-weight: 550;text-align: center;">
						暂无记录
					</view>
				</view>
				<view class="loading-text" @click="toarticlexq(value.projectid)" v-for="(value,key) in out_log" :key="key" style="height: 50upx;line-height: 50upx;">
					<text style="display: block;width: 300upx;">{{value.time}}</text>
					<text>{{value.num}}</text>
					<text>{{value.remark}}</text>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script> 
	import uniLoadMore from '../../../../components/uni-load-more.vue';
	export default {
		components: {
			uniLoadMore
		},
		data() {
			return {
				openid:'',
				out_log:[],
				jfz:'',
				jfz_out:'',
				code:'',
			}
		},
		onLoad: function(e) {
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.getdata()
					// this.getdata2()
					//页面一加载时请求一次数据`
					uni.hideLoading()
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
		},
		methods: {
			getdata(){
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=tzz.index.fhz_index&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						console.log(res)
						this.out_log = res.data.out_log
						this.code = res.data.error
					},
					fail: () => {},
					complete: () => {}
				});
			},
			obtain() {
				uni.navigateTo({
					url:'obtain/obtain?type='+ 1
				})
			},
			getdata2(){
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=tzz.jfz_index&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						// console.log(res)
						this.jfz_out = res.data.list
						this.jfz = res.data.jfz
					},
					fail: () => {},
					complete: () => {}
				});
			},
		},
	}
</script>

<style>
	page {background-color: #fff;}
.container {
	/* background-color: #FEA23D; */
}
.loading-text {
	margin: ;
	background-color: fff;
	display: flex;
}

.loading-text text:nth-child(1) {
	padding-left: 15upx;
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1.5;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(2) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(3) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(4) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 5;
	text-align: center;
	font-size: 26upx;
}
.all_add {
	height: 80upx;
	text-align: center;
	line-height: 80upx;
	background-color: rgb(254,162,61);
	color: #fff;
}
.big-loading-text {
	font-weight: 550;
	border-bottom: 2upx solid rgb(243,243,243);
}
uni-page-body{height:100%;}
</style>

